package com.shy.service.impl;

import com.shy.dao.IBookDao;
import com.shy.dao.IUserDao;
import com.shy.dao.impl.UserDao;
import com.shy.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BookService implements IBookService {

    @Autowired
    private IBookDao bookDao;

    @Autowired
    private IUserDao userDao;

//    public BookService(IBookDao bookDao) {
//        this.bookDao = bookDao;
//    }

    public BookService(IBookDao bookDao, IUserDao userDao) {
        this.userDao = userDao;
        this.bookDao = bookDao;
    }

    @Override
    public String findAll() {
        return bookDao.findAll();
    }

    @Override
    public String findUsers() {
        return userDao.findAll();
    }

}
